package chenjun.mydatabindingdemo.constant;

/**
 * Created by n6 on 2016/9/29.
 */
public class StringUrl {
    private final static String KEY = "819d74b89232eab4281f429b4198ec6e";

    //    http://japi.juhe.cn/joke/content/list.from?key=819d74b89232eab4281f429b4198ec6e&page=2&pagesize=10&sort=asc&time=1418745237---------------------------按更新时间查询数据
    public static String getJokeByTime(int page, int pagesize, String sort, long time) {
        return "http://japi.juhe.cn/joke/content/list.from?key=" + KEY + "&page=" + page + "&pagesize=" + pagesize + "&sort=" + sort + "&time=" + time;
    }

    //    http://japi.juhe.cn/joke/content/text.from?key=819d74b89232eab4281f429b4198ec6e&page=0&pagesize=30 ---------------------------------------------------最新笑话
    public static String getLastJoke(int page, int pagesize) {
        return "http://japi.juhe.cn/joke/content/text.from?key=" + KEY + "&page=" + page + "&pagesize=" + pagesize;
    }

    //    http://japi.juhe.cn/joke/img/list.from?key=您申请的KEY&page=2&pagesize=10&sort=asc&time=1418745237-------------------------------按时间更新查询趣图
    public static String getInterImg(int page, int pagesize, String sort, long time) {
        return "http://japi.juhe.cn/joke/img/list.from?key=" + KEY + "&page=" + page + "&pagesize=" + pagesize + "&sort=" + sort + "&time=" + time;
    }

    //    http://japi.juhe.cn/joke/img/text.from?key=819d74b89232eab4281f429b4198ec6e&page=1&pagesize=10--------------------------------------------------------最新趣图
    public static String getLastInterImg(int page, int pagesize) {
        return "http://japi.juhe.cn/joke/img/text.from?key=" + KEY + "&page=" + page + "&pagesize=" + pagesize;
    }

    //  http://v.juhe.cn/joke/randJoke.php?key=你申请的key&type=pic----------------------------------------------------------------------随机获取趣图/笑话
    //	type	string	否	类型(pic:趣图,不传默认为笑话)
    public static String getRandomImgOrText(String type) {
        return "http://v.juhe.cn/joke/randJoke.php?key=" + KEY + "key&type=" + type;
    }
}
